<!DOCTYPE html>
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>min_max_gray [HALCON算子参考手册]</title>
<style type="text/css">
      body {
    color: #000000;
    background-color: #ffffff;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
}

.body_main {
    margin-left: 35px;
    margin-right: 35px;
}

@media screen and (min-width:992px) {

    .body_main {
        margin-left: 10%;
        margin-right: 10%;
    }

    table.toctable {
        width: 80%
    }
}

@media screen and (min-width:1400px) {

    .body_main {
        margin-left: 15%;
        margin-right: 15%;
    }

    table.toctable {
        width: 70%
    }
}

body>div ul ul {
    margin-left: inherit;
}

a:link {
    color: #0044cc;
}

a:link,
a:visited {
    text-decoration: none;
}

a:link:hover,
a:visited:hover {
    text-decoration: underline;
}

th {
    text-align: left;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    text-rendering: optimizeLegibility;
    color: #666666;
}

code {
    font-family: monospace,monospace;
}

h1 a.halconoperator {
    font-family: Arial, Helvetica, sans-serif;
    color: #666666;
}

h2 a.halconoperator {
    font-family: Arial, Helvetica, sans-serif;
    color: #666666;
}

hr {
    border: 0;
    border-top: solid 1px #f28d26;
}

.pre {
    display: block;
    padding-bottom: 1ex;
    font-family: monospace;
    white-space: pre;
}

pre {
    font-family: monospace, monospace;
    padding: 1ex;
    white-space: pre-wrap;
}

.toc {
    font-size: 80%;
    border-top: 1px dashed #f28d26;
    border-bottom: 1px dashed #f28d26;
    padding-top: 5px;
    padding-bottom: 5px;
}

.inv {
    margin: 0;
    border: 0;
    padding: 0;
}

.banner {
    color: #666666;
    padding-left: 1em;
}

.logo {
    background-color: white;
}

.keyboard {
    font-size: 80%;
    padding-left: 3px;
    padding-right: 3px;
    border-radius: 5px;
    border-width: 1px;
    border-style: solid;
    border-color: #f28d26;
    background-color: #f3f3f3;
}

.warning {
    margin-top: 2ex;
    margin-bottom: 1ex;
    padding: 10px;
    text-align: center;
    border: 1px solid;
    color: #bb0000;
    background-color: #fff7f7
}

.imprint {
    margin-top: 1ex;
    font-size: 80%;
    color: #666666;
}

.imprinthead {
    font-weight: bolder;
    color: #666666;
}

.indexlink {
    text-align: right;
    padding-bottom: 5px;
}

.postscript {
    margin-top: 2ex;
    font-size: 80%;
    color: #666666
}

.evenrow {
    background-color: #e7e7ef;
    vertical-align: top;
}

.oddrow {
    background-color: #f7f7ff;
    vertical-align: top;
}

.headrow {
    background-color: #97979f;
    color: #ffffff;
    vertical-align: top;
}

.logorow {
    vertical-align: top;
}

.error {
    color: red;
}

.var {
    font-style: italic
}

.halconoperator {
    font-family: monospace, monospace;
}

span.operator {
    font-family: monospace, monospace;
}

span.procedure {
    font-family: monospace, monospace;
}

span.operation {
    font-family: monospace, monospace;
}

span.feature {
    font-family: Arial, Helvetica, Homerton, sans-serif;
}

ul {
    padding-left: 1.2em;
}

li.dot {
    list-style-type: square;
    color: #f28d26;
}

.breadcrumb {
    font-size: 80%;
    color: white;
    background-color: #062d64;
    margin-bottom: 20px;
    padding-left: 35px;
    padding-right: 35px;
    padding-bottom: 15px;
}

.webbar {
    font-size: 80%;
    background-color: #dddddd;
    margin-top: 0px;
    margin-left: -35px;
    margin-right: -35px;
    margin-bottom: 0px;
    padding-top: 5px;
    padding-left: 35px;
    padding-right: 35px;
    padding-bottom: 5px;
}

.footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    border-top: 1px dashed #f28d26;
    font-size: 80%;
    color: #666666;
    padding-bottom: 8px;
}

.footer .socialmedia a {
    padding-left: 7px;
}

.socialmedia {
    padding-top: 10px;
}

.copyright {
    margin-top: 19px;
}

.breadcrumb a {
    color: #ffffff;
    border-bottom: 1px solid white;
}

.breadcrumb a:link:hover,
.breadcrumb a:visited:hover {
    text-decoration: none;
    border-bottom: none;
}

.heading {
    margin-top: 1ex;
    font-size: 110%;
    font-weight: bold;
    color: #666666;
}

.text {
    color: black;
}

.example {
    font-size: 80%;
    background-color: #f3f3f3;
    border: 1px dashed #666666;
    padding: 10px;
}

.displaymath {
    display: block;
    text-align: center;
    margin-top: 1ex;
    margin-bottom: 1ex;
}

.title {
    float: left;
    padding-top: 3px;
    padding-bottom: 3px;
}

.signnote {
    font-family: Arial, Helvetica, Homerton, sans-serif;
    font-size: 80%;
    color: #666666;
    font-weight: lighter;
    font-style: italic
}

.par {
    margin-bottom: 1.5em;
}

.parhead {
    text-align: right;
}

.parname {
    float: left;
}

.pardesc {
    font-size: 85%;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    margin-left: 2em;
}

.parcat {
    color: #666;
    font-weight: bold;
}

*[data-if=cpp],
*[data-if=c],
*[data-if=dotnet],
*[data-if=com],
*[data-if=python] {
    display: none;
}

.tabbar {
    text-align: right;
    border-bottom: 1px solid #f28d26;
    margin-bottom: 0.5em;
}

ul.tabs {
    padding-top: 3px;
    padding-bottom: 3px;
    margin-top: 10px;
    margin-bottom: 0;
    font-size: 80%
}

ul.tabs li {
    padding-top: 3px;
    padding-bottom: 3px;
    display: inline;
    overflow: hidden;
    list-style-type: none;
    margin: 0;
    margin-left: 8px;
    border-top: 1px solid #666;
    border-left: 1px solid #666;
    border-right: 1px solid #666;
}

ul.tabs li.active {
    border-left: 1px solid #f28d26;
    border-right: 1px solid #f28d26;
    border-top: 1px solid #f28d26;
    border-bottom: 1px solid #fff;
}

ul.tabs li.inactive {
    background-color: #eee;
}

ul.tabs li a {
    padding-left: 5px;
    padding-right: 5px;
    color: #666;
}

ul.tabs li a:link:hover {
    text-decoration: none;
}

ul.tabs li.inactive a {
    color: #666;
}

ul.tabs li.active a {
    color: black;
}

dl.generic dd {
    margin-bottom: 1em;
}

.pari {
    color: olive;
}

.paro {
    color: maroon;
}

.comment {
    font-size: 80%;
    color: green;
    white-space: nowrap;
}

table.grid {
    border-collapse: collapse;
}

table.grid td {
    padding: 5px;
    border: 1px solid;
}

table.layout {
    border: 0px;
}

table.layout td {
    padding: 5px;
}

table.table {
    border-collapse: collapse;
}

table.table td {
    padding: 5px;
    border-left: 0px;
    border-right: 0px;
}

table.table tr:last-child {
    border-bottom: 1px solid;
}

table.table th {
    padding: 5px;
    border-top: 1px solid;
    border-bottom: 1px solid;
    border-left: 0px;
    border-right: 0px;
}

.details_summary {
    cursor: pointer;
}

table.toctable {
    width: 100%;
}

table.toctable col:first-child {
    width: 20%;
}

table.toctable col:nth-last-child(2) {
    width: 8%;
}

table.altcolored tr:nth-child(even) {
    background-color: #f3f3f3;
}

    </style>
<!--OP_REF_STYLE_END-->
<script>
    <!--
var active_lang='hdevelop';function switchVisibility(obj,active_lang,new_lang)
{var display_style='inline';
for(var i=0;i<obj.length;i++)
{if(obj.item(i).getAttribute('data-if')==new_lang)
{obj.item(i).style.display=display_style;}
if(obj.item(i).getAttribute('data-if')==active_lang)
{obj.item(i).style.display='none';}}
return;}
function toggleLanguage(new_lang,initial)
{if(active_lang!=new_lang)
{var lis=document.getElementsByTagName('li');for(var i=0;i<lis.length;i++)
{if(lis.item(i).id=='syn-'+new_lang)
{lis.item(i).className='active';}
else
{lis.item(i).className='inactive';}}
var divs=document.getElementsByTagName('div');var spans=document.getElementsByTagName('span');switchVisibility(divs,active_lang,new_lang);switchVisibility(spans,active_lang,new_lang);if(!initial)
{setCookie("halcon_reference_language",new_lang,null,null);}
active_lang=new_lang;}
return;}
function setCookie(name,value,domain,exp_offset,path,secure)
{localStorage.setItem(name,value);}
function getCookie(name)
{return localStorage.getItem(name);}
function initialize()
{var qs=location.href.split('?')[1];var qs_lang_raw=location.href.split('interface=')[1];var qs_lang;if(qs_lang_raw)
{qs_lang=qs_lang_raw.split('#')[0];}
var cookie_lang=getCookie("halcon_reference_language");var new_lang;if((qs_lang=="hdevelop")||(qs_lang=="dotnet")||(qs_lang=="python")||(qs_lang=="cpp")||(qs_lang=="c"))
{new_lang=qs_lang;setCookie("halcon_reference_language",new_lang,null,null);}
else if((cookie_lang=="hdevelop")||(cookie_lang=="dotnet")||(cookie_lang=="python")||(cookie_lang=="cpp")||(cookie_lang=="c"))
{new_lang=cookie_lang;}
else
{new_lang="hdevelop";}
toggleLanguage(new_lang,1);return;}
-->

  </script>
</head>
<body onload="initialize();">
<div class="breadcrumb">
<br class="inv"><a href="index.html">目录</a> / <a href="toc_image.html">Image</a> / <a href="toc_image_features.html">特征</a><br class="inv">
</div>
<div class="body_main">
<div class="tabbar"><ul class="tabs">
<li id="syn-hdevelop" class="active"><a href="javascript:void(0);" onclick="toggleLanguage('hdevelop')" onfocus="blur()">HDevelop</a></li>
<li id="syn-dotnet" class="inactive"><a href="javascript:void(0);" onclick="toggleLanguage('dotnet')" onfocus="blur()">.NET</a></li>
<li id="syn-python" class="inactive"><a href="javascript:void(0);" onclick="toggleLanguage('python')" onfocus="blur()">Python</a></li>
<li id="syn-cpp" class="inactive"><a href="javascript:void(0);" onclick="toggleLanguage('cpp')" onfocus="blur()">C++</a></li>
<li id="syn-c" class="inactive"><a href="javascript:void(0);" onclick="toggleLanguage('c')" onfocus="blur()">C</a></li>
</ul></div>
<div class="indexlink">
<a href="index_classes.html"><span data-if="dotnet" style="display:none;">类别</span><span data-if="cpp" style="display:none;">类别</span></a><span data-if="dotnet" style="display:none;"> | </span><span data-if="cpp" style="display:none;"> | </span><a href="index_by_name.html">算子列表</a>
</div>
<!--OP_REF_HEADER_END-->
<h1 id="sec_name">
<span data-if="hdevelop" style="display:inline;">min_max_gray</span><span data-if="c" style="display:none;">min_max_gray</span><span data-if="cpp" style="display:none;">MinMaxGray</span><span data-if="dotnet" style="display:none;">MinMaxGray</span><span data-if="python" style="display:none;">min_max_gray</span> (算子名称)</h1>
<h2>名称</h2>
<p><code><span data-if="hdevelop" style="display:inline;">min_max_gray</span><span data-if="c" style="display:none;">min_max_gray</span><span data-if="cpp" style="display:none;">MinMaxGray</span><span data-if="dotnet" style="display:none;">MinMaxGray</span><span data-if="python" style="display:none;">min_max_gray</span></code> — Determine the minimum and maximum gray values within regions.</p>
<h2 id="sec_synopsis">参数签名</h2>
<div data-if="hdevelop" style="display:inline;">
<p>
<code><b>min_max_gray</b>(<a href="#Regions"><i>区域</i></a>, <a href="#Image"><i>Image</i></a> :  : <a href="#Percent"><i>Percent</i></a> : <a href="#Min"><i>Min</i></a>, <a href="#Max"><i>Max</i></a>, <a href="#Range"><i>Range</i></a>)</code></p>
</div>
<div data-if="c" style="display:none;">
<p>
<code>Herror <b>min_max_gray</b>(const Hobject <a href="#Regions"><i>区域</i></a>, const Hobject <a href="#Image"><i>Image</i></a>, double <a href="#Percent"><i>Percent</i></a>, double* <a href="#Min"><i>Min</i></a>, double* <a href="#Max"><i>Max</i></a>, double* <a href="#Range"><i>Range</i></a>)</code></p>
<p>
<code>Herror <b>T_min_max_gray</b>(const Hobject <a href="#Regions"><i>区域</i></a>, const Hobject <a href="#Image"><i>Image</i></a>, const Htuple <a href="#Percent"><i>Percent</i></a>, Htuple* <a href="#Min"><i>Min</i></a>, Htuple* <a href="#Max"><i>Max</i></a>, Htuple* <a href="#Range"><i>Range</i></a>)</code></p>
</div>
<div data-if="cpp" style="display:none;">
<p>
<code>void <b>MinMaxGray</b>(const HObject&amp; <a href="#Regions"><i>区域</i></a>, const HObject&amp; <a href="#Image"><i>Image</i></a>, const HTuple&amp; <a href="#Percent"><i>Percent</i></a>, HTuple* <a href="#Min"><i>Min</i></a>, HTuple* <a href="#Max"><i>Max</i></a>, HTuple* <a href="#Range"><i>Range</i></a>)</code></p>
<p>
<code>void <a href="HImage.html">HImage</a>::<b>MinMaxGray</b>(const HRegion&amp; <a href="#Regions"><i>区域</i></a>, const HTuple&amp; <a href="#Percent"><i>Percent</i></a>, HTuple* <a href="#Min"><i>Min</i></a>, HTuple* <a href="#Max"><i>Max</i></a>, HTuple* <a href="#Range"><i>Range</i></a>) const</code></p>
<p>
<code>void <a href="HImage.html">HImage</a>::<b>MinMaxGray</b>(const HRegion&amp; <a href="#Regions"><i>区域</i></a>, double <a href="#Percent"><i>Percent</i></a>, double* <a href="#Min"><i>Min</i></a>, double* <a href="#Max"><i>Max</i></a>, double* <a href="#Range"><i>Range</i></a>) const</code></p>
<p>
<code>void <a href="HRegion.html">HRegion</a>::<b>MinMaxGray</b>(const HImage&amp; <a href="#Image"><i>Image</i></a>, const HTuple&amp; <a href="#Percent"><i>Percent</i></a>, HTuple* <a href="#Min"><i>Min</i></a>, HTuple* <a href="#Max"><i>Max</i></a>, HTuple* <a href="#Range"><i>Range</i></a>) const</code></p>
<p>
<code>void <a href="HRegion.html">HRegion</a>::<b>MinMaxGray</b>(const HImage&amp; <a href="#Image"><i>Image</i></a>, double <a href="#Percent"><i>Percent</i></a>, double* <a href="#Min"><i>Min</i></a>, double* <a href="#Max"><i>Max</i></a>, double* <a href="#Range"><i>Range</i></a>) const</code></p>
</div>
<div data-if="com" style="display:none;"></div>
<div data-if="dotnet" style="display:none;">
<p>
<code>static void <a href="HOperatorSet.html">HOperatorSet</a>.<b>MinMaxGray</b>(<a href="HObject.html">HObject</a> <a href="#Regions"><i>区域</i></a>, <a href="HObject.html">HObject</a> <a href="#Image"><i>image</i></a>, <a href="HTuple.html">HTuple</a> <a href="#Percent"><i>percent</i></a>, out <a href="HTuple.html">HTuple</a> <a href="#Min"><i>min</i></a>, out <a href="HTuple.html">HTuple</a> <a href="#Max"><i>max</i></a>, out <a href="HTuple.html">HTuple</a> <a href="#Range"><i>range</i></a>)</code></p>
<p>
<code>void <a href="HImage.html">HImage</a>.<b>MinMaxGray</b>(<a href="HRegion.html">HRegion</a> <a href="#Regions"><i>区域</i></a>, <a href="HTuple.html">HTuple</a> <a href="#Percent"><i>percent</i></a>, out <a href="HTuple.html">HTuple</a> <a href="#Min"><i>min</i></a>, out <a href="HTuple.html">HTuple</a> <a href="#Max"><i>max</i></a>, out <a href="HTuple.html">HTuple</a> <a href="#Range"><i>range</i></a>)</code></p>
<p>
<code>void <a href="HImage.html">HImage</a>.<b>MinMaxGray</b>(<a href="HRegion.html">HRegion</a> <a href="#Regions"><i>区域</i></a>, double <a href="#Percent"><i>percent</i></a>, out double <a href="#Min"><i>min</i></a>, out double <a href="#Max"><i>max</i></a>, out double <a href="#Range"><i>range</i></a>)</code></p>
<p>
<code>void <a href="HRegion.html">HRegion</a>.<b>MinMaxGray</b>(<a href="HImage.html">HImage</a> <a href="#Image"><i>image</i></a>, <a href="HTuple.html">HTuple</a> <a href="#Percent"><i>percent</i></a>, out <a href="HTuple.html">HTuple</a> <a href="#Min"><i>min</i></a>, out <a href="HTuple.html">HTuple</a> <a href="#Max"><i>max</i></a>, out <a href="HTuple.html">HTuple</a> <a href="#Range"><i>range</i></a>)</code></p>
<p>
<code>void <a href="HRegion.html">HRegion</a>.<b>MinMaxGray</b>(<a href="HImage.html">HImage</a> <a href="#Image"><i>image</i></a>, double <a href="#Percent"><i>percent</i></a>, out double <a href="#Min"><i>min</i></a>, out double <a href="#Max"><i>max</i></a>, out double <a href="#Range"><i>range</i></a>)</code></p>
</div>
<div data-if="python" style="display:none;">
<p>
<code>def <b>min_max_gray</b>(<a href="#Regions"><i>区域</i></a>: HObject, <a href="#Image"><i>image</i></a>: HObject, <a href="#Percent"><i>percent</i></a>: Union[int, float]) -&gt; Tuple[Sequence[float], Sequence[float], Sequence[float]]</code></p>
<p>
<code>def <b>min_max_gray_s</b>(<a href="#Regions"><i>区域</i></a>: HObject, <a href="#Image"><i>image</i></a>: HObject, <a href="#Percent"><i>percent</i></a>: Union[int, float]) -&gt; Tuple[float, float, float]</code></p>
</div>
<h2 id="sec_description">描述</h2>
<p>该算子 <code><span data-if="hdevelop" style="display:inline">min_max_gray</span><span data-if="c" style="display:none">min_max_gray</span><span data-if="cpp" style="display:none">MinMaxGray</span><span data-if="com" style="display:none">MinMaxGray</span><span data-if="dotnet" style="display:none">MinMaxGray</span><span data-if="python" style="display:none">min_max_gray</span></code> creates the histogram of the
absolute frequencies of the gray values within <a href="#Regions"><i><code><span data-if="hdevelop" style="display:inline">区域</span><span data-if="c" style="display:none">区域</span><span data-if="cpp" style="display:none">区域</span><span data-if="com" style="display:none">区域</span><span data-if="dotnet" style="display:none">区域</span><span data-if="python" style="display:none">区域</span></code></i></a> in
the input image <a href="#Image"><i><code><span data-if="hdevelop" style="display:inline">Image</span><span data-if="c" style="display:none">Image</span><span data-if="cpp" style="display:none">Image</span><span data-if="com" style="display:none">Image</span><span data-if="dotnet" style="display:none">image</span><span data-if="python" style="display:none">image</span></code></i></a> (see <a href="gray_histo.html"><code><span data-if="hdevelop" style="display:inline">gray_histo</span><span data-if="c" style="display:none">gray_histo</span><span data-if="cpp" style="display:none">GrayHisto</span><span data-if="com" style="display:none">GrayHisto</span><span data-if="dotnet" style="display:none">GrayHisto</span><span data-if="python" style="display:none">gray_histo</span></code></a>) and
calculates the number of pixels <a href="#Percent"><i><code><span data-if="hdevelop" style="display:inline">Percent</span><span data-if="c" style="display:none">Percent</span><span data-if="cpp" style="display:none">Percent</span><span data-if="com" style="display:none">Percent</span><span data-if="dotnet" style="display:none">percent</span><span data-if="python" style="display:none">percent</span></code></i></a> corresponding to
the area of the input image.  Then it goes inwards on both sides of
the histogram by this number of pixels and determines the smallest
and the largest gray value:
</p>
<dl class="generic">

<dt><b></b></dt>
<dd>
<p>
 <i>Example:</i> </p>
<p>
With area = 60, <a href="#Percent"><i><code><span data-if="hdevelop" style="display:inline">Percent</span><span data-if="c" style="display:none">Percent</span><span data-if="cpp" style="display:none">Percent</span><span data-if="com" style="display:none">Percent</span><span data-if="dotnet" style="display:none">percent</span><span data-if="python" style="display:none">percent</span></code></i></a> = <i>5</i>, d.h. i.e. 3 pixels,
histogram = [2,8,0,7,13,0,0,...,0,10,10,5,3,1,1],</p>
<p>
<span title="1" style="vertical-align:-0.0991602em" class="math"><!-- Created by MetaPost 1.902 on 2023.05.15:2033 --><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="1.12226em" height="0.573321em" viewBox="0 0 17.956207 9.173141">
<!-- Original BoundingBox: -8.978104 -4.586578 8.978104 4.586563 -->
  <defs>
    <g transform="scale(0.009963,0.009963)" id="GLYPHcmsy10_41">
      <path style="fill-rule: evenodd;" d="M726.000000 -327.000000C768.000000 -291.000000,819.000000 -265.000000,852.000000 -250.000000C816.000000 -234.000000,767.000000 -208.000000,726.000000 -173.000000L91.000000 -173.000000C74.000000 -173.000000,55.000000 -173.000000,55.000000 -153.000000C55.000000 -133.000000,73.000000 -133.000000,90.000000 -133.000000L681.000000 -133.000000C633.000000 -87.000000,581.000000 1.000000,581.000000 14.000000C581.000000 25.000000,594.000000 25.000000,600.000000 25.000000C608.000000 25.000000,615.000000 25.000000,619.000000 17.000000C640.000000 -21.000000,668.000000 -74.000000,733.000000 -132.000000C802.000000 -193.000000,869.000000 -220.000000,921.000000 -235.000000C938.000000 -241.000000,939.000000 -242.000000,941.000000 -244.000000C943.000000 -245.000000,943.000000 -248.000000,943.000000 -250.000000C943.000000 -252.000000,943.000000 -254.000000,942.000000 -256.000000L939.000000 -258.000000C937.000000 -259.000000,936.000000 -260.000000,917.000000 -266.000000C782.000000 -306.000000,682.000000 -397.000000,626.000000 -504.000000C615.000000 -524.000000,614.000000 -525.000000,600.000000 -525.000000C594.000000 -525.000000,581.000000 -525.000000,581.000000 -514.000000C581.000000 -501.000000,632.000000 -414.000000,681.000000 -367.000000L90.000000 -367.000000C73.000000 -367.000000,55.000000 -367.000000,55.000000 -347.000000C55.000000 -327.000000,74.000000 -327.000000,91.000000 -327.000000"></path>
    </g>
  </defs>
  <g transform="matrix(1.600006,-0.000000,-0.000000,1.600006,0.037888 7.586578)" style="fill: rgb(0.000000%,0.000000%,0.000000%);">
    <use xlink:href="#GLYPHcmsy10_41"></use>
  </g>
</svg></span> Minimum = 0, Maximum = 255, range = 255</p>
<p>
<code><span data-if="hdevelop" style="display:inline">min_max_gray</span><span data-if="c" style="display:none">min_max_gray</span><span data-if="cpp" style="display:none">MinMaxGray</span><span data-if="com" style="display:none">MinMaxGray</span><span data-if="dotnet" style="display:none">MinMaxGray</span><span data-if="python" style="display:none">min_max_gray</span></code> returns:
<a href="#Min"><i><code><span data-if="hdevelop" style="display:inline">Min</span><span data-if="c" style="display:none">Min</span><span data-if="cpp" style="display:none">Min</span><span data-if="com" style="display:none">Min</span><span data-if="dotnet" style="display:none">min</span><span data-if="python" style="display:none">min</span></code></i></a> = <i>1</i>,
<a href="#Max"><i><code><span data-if="hdevelop" style="display:inline">Max</span><span data-if="c" style="display:none">Max</span><span data-if="cpp" style="display:none">Max</span><span data-if="com" style="display:none">Max</span><span data-if="dotnet" style="display:none">max</span><span data-if="python" style="display:none">max</span></code></i></a> = <i>253</i>,
<a href="#Range"><i><code><span data-if="hdevelop" style="display:inline">Range</span><span data-if="c" style="display:none">Range</span><span data-if="cpp" style="display:none">Range</span><span data-if="com" style="display:none">Range</span><span data-if="dotnet" style="display:none">range</span><span data-if="python" style="display:none">range</span></code></i></a> = <i>252</i>.
</p>
</dd>
</dl>
<p>For images of type <code>int4</code>, <code>int8</code>, and <code>real</code>,
the above calculation is not performed via histograms, but using a rank
selection algorithm.
If <a href="#Percent"><i><code><span data-if="hdevelop" style="display:inline">Percent</span><span data-if="c" style="display:none">Percent</span><span data-if="cpp" style="display:none">Percent</span><span data-if="com" style="display:none">Percent</span><span data-if="dotnet" style="display:none">percent</span><span data-if="python" style="display:none">percent</span></code></i></a> is set to <i>50</i>,
<a href="#Min"><i><code><span data-if="hdevelop" style="display:inline">Min</span><span data-if="c" style="display:none">Min</span><span data-if="cpp" style="display:none">Min</span><span data-if="com" style="display:none">Min</span><span data-if="dotnet" style="display:none">min</span><span data-if="python" style="display:none">min</span></code></i></a> = <a href="#Max"><i><code><span data-if="hdevelop" style="display:inline">Max</span><span data-if="c" style="display:none">Max</span><span data-if="cpp" style="display:none">Max</span><span data-if="com" style="display:none">Max</span><span data-if="dotnet" style="display:none">max</span><span data-if="python" style="display:none">max</span></code></i></a> = Median.
If <a href="#Percent"><i><code><span data-if="hdevelop" style="display:inline">Percent</span><span data-if="c" style="display:none">Percent</span><span data-if="cpp" style="display:none">Percent</span><span data-if="com" style="display:none">Percent</span><span data-if="dotnet" style="display:none">percent</span><span data-if="python" style="display:none">percent</span></code></i></a> is <i>0</i> no histogram is calculated in
order to enhance the runtime.</p>
<h2 id="sec_attention">注意</h2>
<p>Note that 该算子 <code><span data-if="hdevelop" style="display:inline">min_max_gray</span><span data-if="c" style="display:none">min_max_gray</span><span data-if="cpp" style="display:none">MinMaxGray</span><span data-if="com" style="display:none">MinMaxGray</span><span data-if="dotnet" style="display:none">MinMaxGray</span><span data-if="python" style="display:none">min_max_gray</span></code> only considers
the given <a href="#Regions"><i><code><span data-if="hdevelop" style="display:inline">区域</span><span data-if="c" style="display:none">区域</span><span data-if="cpp" style="display:none">区域</span><span data-if="com" style="display:none">区域</span><span data-if="dotnet" style="display:none">区域</span><span data-if="python" style="display:none">区域</span></code></i></a> and ignores any previously set domain
of the input image <a href="#Image"><i><code><span data-if="hdevelop" style="display:inline">Image</span><span data-if="c" style="display:none">Image</span><span data-if="cpp" style="display:none">Image</span><span data-if="com" style="display:none">Image</span><span data-if="dotnet" style="display:none">image</span><span data-if="python" style="display:none">image</span></code></i></a>.</p>
<h2 id="sec_execution">运行信息</h2>
<ul>
  <li>多线程类型:可重入(与非独占操作符并行运行)。</li>
<li>多线程作用域:全局(可以从任何线程调用)。</li>
  
    <li>在元组级别自动并行化。</li>
  
</ul>
<h2 id="sec_parameters">参数表</h2>
  <div class="par">
<div class="parhead">
<span id="Regions" class="parname"><b><code><span data-if="hdevelop" style="display:inline">区域</span><span data-if="c" style="display:none">区域</span><span data-if="cpp" style="display:none">区域</span><span data-if="com" style="display:none">区域</span><span data-if="dotnet" style="display:none">区域</span><span data-if="python" style="display:none">区域</span></code></b> (input_object)  </span><span>region(-array) <code>→</code> <span data-if="hdevelop" style="display:inline">object</span><span data-if="dotnet" style="display:none"><a href="HRegion.html">HRegion</a></span><span data-if="python" style="display:none">HObject</span><span data-if="cpp" style="display:none"><a href="HRegion.html">HRegion</a></span><span data-if="c" style="display:none">Hobject</span></span>
</div>
<p class="pardesc">Regions, the features of which are to be calculated.</p>
</div>
  <div class="par">
<div class="parhead">
<span id="Image" class="parname"><b><code><span data-if="hdevelop" style="display:inline">Image</span><span data-if="c" style="display:none">Image</span><span data-if="cpp" style="display:none">Image</span><span data-if="com" style="display:none">Image</span><span data-if="dotnet" style="display:none">image</span><span data-if="python" style="display:none">image</span></code></b> (input_object)  </span><span>singlechannelimage <code>→</code> <span data-if="hdevelop" style="display:inline">object</span><span data-if="dotnet" style="display:none"><a href="HImage.html">HImage</a></span><span data-if="python" style="display:none">HObject</span><span data-if="cpp" style="display:none"><a href="HImage.html">HImage</a></span><span data-if="c" style="display:none">Hobject</span> (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real)</span>
</div>
<p class="pardesc">Gray value image.</p>
</div>
  <div class="par">
<div class="parhead">
<span id="Percent" class="parname"><b><code><span data-if="hdevelop" style="display:inline">Percent</span><span data-if="c" style="display:none">Percent</span><span data-if="cpp" style="display:none">Percent</span><span data-if="com" style="display:none">Percent</span><span data-if="dotnet" style="display:none">percent</span><span data-if="python" style="display:none">percent</span></code></b> (input_control)  </span><span>number <code>→</code> <span data-if="dotnet" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="python" style="display:none">Union[int, float]</span><span data-if="cpp" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="c" style="display:none">Htuple</span><span data-if="hdevelop" style="display:inline"> (real / </span><span data-if="hdevelop" style="display:inline">integer)</span><span data-if="dotnet" style="display:none"> (<i>double</i> / </span><span data-if="dotnet" style="display:none">int / </span><span data-if="dotnet" style="display:none">long)</span><span data-if="cpp" style="display:none"> (<i>double</i> / </span><span data-if="cpp" style="display:none">Hlong)</span><span data-if="c" style="display:none"> (<i>double</i> / </span><span data-if="c" style="display:none">Hlong)</span></span>
</div>
<p class="pardesc">Percentage below (above) the absolute maximum
(minimum).</p>
<p class="pardesc"><span class="parcat">Default:
      </span>0</p>
<p class="pardesc"><span class="parcat">Suggested values:
      </span>0, 1, 2, 5, 7, 10, 15, 20, 30, 40, 50</p>
<p class="pardesc"><span class="parcat">Restriction:
      </span><code>0 &lt;= Percent &amp;&amp; Percent &lt;= 50</code></p>
</div>
  <div class="par">
<div class="parhead">
<span id="Min" class="parname"><b><code><span data-if="hdevelop" style="display:inline">Min</span><span data-if="c" style="display:none">Min</span><span data-if="cpp" style="display:none">Min</span><span data-if="com" style="display:none">Min</span><span data-if="dotnet" style="display:none">min</span><span data-if="python" style="display:none">min</span></code></b> (output_control)  </span><span>real(-array) <code>→</code> <span data-if="dotnet" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="python" style="display:none">Sequence[float]</span><span data-if="cpp" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="c" style="display:none">Htuple</span><span data-if="hdevelop" style="display:inline"> (real)</span><span data-if="dotnet" style="display:none"> (<i>double</i>)</span><span data-if="cpp" style="display:none"> (<i>double</i>)</span><span data-if="c" style="display:none"> (<i>double</i>)</span></span>
</div>
<p class="pardesc">“Minimum” gray value.</p>
</div>
  <div class="par">
<div class="parhead">
<span id="Max" class="parname"><b><code><span data-if="hdevelop" style="display:inline">Max</span><span data-if="c" style="display:none">Max</span><span data-if="cpp" style="display:none">Max</span><span data-if="com" style="display:none">Max</span><span data-if="dotnet" style="display:none">max</span><span data-if="python" style="display:none">max</span></code></b> (output_control)  </span><span>real(-array) <code>→</code> <span data-if="dotnet" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="python" style="display:none">Sequence[float]</span><span data-if="cpp" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="c" style="display:none">Htuple</span><span data-if="hdevelop" style="display:inline"> (real)</span><span data-if="dotnet" style="display:none"> (<i>double</i>)</span><span data-if="cpp" style="display:none"> (<i>double</i>)</span><span data-if="c" style="display:none"> (<i>double</i>)</span></span>
</div>
<p class="pardesc">“Maximum” gray value.</p>
<p class="pardesc"><span class="parcat">Assertion:
      </span><code>Max &gt;= Min</code></p>
</div>
  <div class="par">
<div class="parhead">
<span id="Range" class="parname"><b><code><span data-if="hdevelop" style="display:inline">Range</span><span data-if="c" style="display:none">Range</span><span data-if="cpp" style="display:none">Range</span><span data-if="com" style="display:none">Range</span><span data-if="dotnet" style="display:none">range</span><span data-if="python" style="display:none">range</span></code></b> (output_control)  </span><span>real(-array) <code>→</code> <span data-if="dotnet" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="python" style="display:none">Sequence[float]</span><span data-if="cpp" style="display:none"><a href="HTuple.html">HTuple</a></span><span data-if="c" style="display:none">Htuple</span><span data-if="hdevelop" style="display:inline"> (real)</span><span data-if="dotnet" style="display:none"> (<i>double</i>)</span><span data-if="cpp" style="display:none"> (<i>double</i>)</span><span data-if="c" style="display:none"> (<i>double</i>)</span></span>
</div>
<p class="pardesc">Difference between Max and Min.</p>
<p class="pardesc"><span class="parcat">Assertion:
      </span><code>Range &gt;= 0</code></p>
</div>
<div data-if="hdevelop" style="display:inline">
<h2 id="sec_example_hdevelop">例程 (HDevelop)</h2>
<pre class="example">
* Threshold segmentation with training region:
read_image(Image,'fabrik')
draw_region(Region,WindowHandle)
min_max_gray(Region,Image,5,Min,Max,Range)
threshold(Image,SegmentedRegion,Min,Max)
dev_display(SegmentedRegion)
</pre>
</div>
<div data-if="c" style="display:none">
<h2 id="sec_example_c">例程 (C)</h2>
<pre class="example">
/* Threshold segmentation with training region: */
read_image(&amp;Image,"fabrik");
draw_region(&amp;Region,WindowHandle);
min_max_gray(Region,Image,5.0,&amp;Min,&amp;Max,NULL);
threshold(Image,&amp;SegmentedRegion,Min,Max);
disp_region(SegmentedRegion,WindowHandle);
</pre>
</div>
<div data-if="cpp" style="display:none">
<h2 id="sec_example_cpp">例程 (HDevelop)</h2>
<pre class="example">
* Threshold segmentation with training region:
read_image(Image,'fabrik')
draw_region(Region,WindowHandle)
min_max_gray(Region,Image,5,Min,Max,Range)
threshold(Image,SegmentedRegion,Min,Max)
dev_display(SegmentedRegion)
</pre>
</div>
<div data-if="com" style="display:none">
<h2 id="sec_example_com">例程 (HDevelop)</h2>
<pre class="example">
* Threshold segmentation with training region:
read_image(Image,'fabrik')
draw_region(Region,WindowHandle)
min_max_gray(Region,Image,5,Min,Max,Range)
threshold(Image,SegmentedRegion,Min,Max)
dev_display(SegmentedRegion)
</pre>
</div>
<div data-if="dotnet" style="display:none">
<h2 id="sec_example_dotnet">例程 (HDevelop)</h2>
<pre class="example">
* Threshold segmentation with training region:
read_image(Image,'fabrik')
draw_region(Region,WindowHandle)
min_max_gray(Region,Image,5,Min,Max,Range)
threshold(Image,SegmentedRegion,Min,Max)
dev_display(SegmentedRegion)
</pre>
</div>
<h2 id="sec_result">结果</h2>
<p>该算子 <code><span data-if="hdevelop" style="display:inline">min_max_gray</span><span data-if="c" style="display:none">min_max_gray</span><span data-if="cpp" style="display:none">MinMaxGray</span><span data-if="com" style="display:none">MinMaxGray</span><span data-if="dotnet" style="display:none">MinMaxGray</span><span data-if="python" style="display:none">min_max_gray</span></code> 返回值 <TT>2</TT> (
      <TT>H_MSG_TRUE</TT>)
     if the
input image has the defined gray values and the parameters are
correct.  The behavior in case of empty input (no input images
available) is set via 该算子
<a href="set_system.html"><code><span data-if="hdevelop" style="display:inline">set_system(::'no_object_result',&lt;Result&gt;:)</span><span data-if="c" style="display:none">set_system("no_object_result",&lt;Result&gt;)</span><span data-if="cpp" style="display:none">SetSystem("no_object_result",&lt;Result&gt;)</span><span data-if="com" style="display:none">SetSystem("no_object_result",&lt;Result&gt;)</span><span data-if="dotnet" style="display:none">SetSystem("no_object_result",&lt;Result&gt;)</span><span data-if="python" style="display:none">set_system("no_object_result",&lt;Result&gt;)</span></code></a>.
The behavior in case of an empty region is set via 该算子
<a href="set_system.html"><code><span data-if="hdevelop" style="display:inline">set_system(::'empty_region_result',&lt;Result&gt;:)</span><span data-if="c" style="display:none">set_system("empty_region_result",&lt;Result&gt;)</span><span data-if="cpp" style="display:none">SetSystem("empty_region_result",&lt;Result&gt;)</span><span data-if="com" style="display:none">SetSystem("empty_region_result",&lt;Result&gt;)</span><span data-if="dotnet" style="display:none">SetSystem("empty_region_result",&lt;Result&gt;)</span><span data-if="python" style="display:none">set_system("empty_region_result",&lt;Result&gt;)</span></code></a>.
If necessary an exception is raised.</p>
<h2 id="sec_predecessors">可能的前置算子</h2>
<p>
<code><a href="draw_region.html"><span data-if="hdevelop" style="display:inline">draw_region</span><span data-if="c" style="display:none">draw_region</span><span data-if="cpp" style="display:none">DrawRegion</span><span data-if="com" style="display:none">DrawRegion</span><span data-if="dotnet" style="display:none">DrawRegion</span><span data-if="python" style="display:none">draw_region</span></a></code>, 
<code><a href="gen_circle.html"><span data-if="hdevelop" style="display:inline">gen_circle</span><span data-if="c" style="display:none">gen_circle</span><span data-if="cpp" style="display:none">GenCircle</span><span data-if="com" style="display:none">GenCircle</span><span data-if="dotnet" style="display:none">GenCircle</span><span data-if="python" style="display:none">gen_circle</span></a></code>, 
<code><a href="gen_ellipse.html"><span data-if="hdevelop" style="display:inline">gen_ellipse</span><span data-if="c" style="display:none">gen_ellipse</span><span data-if="cpp" style="display:none">GenEllipse</span><span data-if="com" style="display:none">GenEllipse</span><span data-if="dotnet" style="display:none">GenEllipse</span><span data-if="python" style="display:none">gen_ellipse</span></a></code>, 
<code><a href="gen_rectangle1.html"><span data-if="hdevelop" style="display:inline">gen_rectangle1</span><span data-if="c" style="display:none">gen_rectangle1</span><span data-if="cpp" style="display:none">GenRectangle1</span><span data-if="com" style="display:none">GenRectangle1</span><span data-if="dotnet" style="display:none">GenRectangle1</span><span data-if="python" style="display:none">gen_rectangle1</span></a></code>, 
<code><a href="threshold.html"><span data-if="hdevelop" style="display:inline">threshold</span><span data-if="c" style="display:none">threshold</span><span data-if="cpp" style="display:none">Threshold</span><span data-if="com" style="display:none">Threshold</span><span data-if="dotnet" style="display:none">Threshold</span><span data-if="python" style="display:none">threshold</span></a></code>, 
<code><a href="regiongrowing.html"><span data-if="hdevelop" style="display:inline">regiongrowing</span><span data-if="c" style="display:none">regiongrowing</span><span data-if="cpp" style="display:none">Regiongrowing</span><span data-if="com" style="display:none">Regiongrowing</span><span data-if="dotnet" style="display:none">Regiongrowing</span><span data-if="python" style="display:none">regiongrowing</span></a></code>
</p>
<h2 id="sec_successors">可能的后置算子</h2>
<p>
<code><a href="threshold.html"><span data-if="hdevelop" style="display:inline">threshold</span><span data-if="c" style="display:none">threshold</span><span data-if="cpp" style="display:none">Threshold</span><span data-if="com" style="display:none">Threshold</span><span data-if="dotnet" style="display:none">Threshold</span><span data-if="python" style="display:none">threshold</span></a></code>
</p>
<h2 id="sec_alternatives">可替代算子</h2>
<p>
<code><a href="select_gray.html"><span data-if="hdevelop" style="display:inline">select_gray</span><span data-if="c" style="display:none">select_gray</span><span data-if="cpp" style="display:none">SelectGray</span><span data-if="com" style="display:none">SelectGray</span><span data-if="dotnet" style="display:none">SelectGray</span><span data-if="python" style="display:none">select_gray</span></a></code>, 
<code><a href="intensity.html"><span data-if="hdevelop" style="display:inline">intensity</span><span data-if="c" style="display:none">intensity</span><span data-if="cpp" style="display:none">Intensity</span><span data-if="com" style="display:none">Intensity</span><span data-if="dotnet" style="display:none">Intensity</span><span data-if="python" style="display:none">intensity</span></a></code>
</p>
<h2 id="sec_see">参考其它</h2>
<p>
<code><a href="gray_histo.html"><span data-if="hdevelop" style="display:inline">gray_histo</span><span data-if="c" style="display:none">gray_histo</span><span data-if="cpp" style="display:none">GrayHisto</span><span data-if="com" style="display:none">GrayHisto</span><span data-if="dotnet" style="display:none">GrayHisto</span><span data-if="python" style="display:none">gray_histo</span></a></code>, 
<code><a href="scale_image.html"><span data-if="hdevelop" style="display:inline">scale_image</span><span data-if="c" style="display:none">scale_image</span><span data-if="cpp" style="display:none">ScaleImage</span><span data-if="com" style="display:none">ScaleImage</span><span data-if="dotnet" style="display:none">ScaleImage</span><span data-if="python" style="display:none">scale_image</span></a></code>, 
<code><a href="scale_image_max.html"><span data-if="hdevelop" style="display:inline">scale_image_max</span><span data-if="c" style="display:none">scale_image_max</span><span data-if="cpp" style="display:none">ScaleImageMax</span><span data-if="com" style="display:none">ScaleImageMax</span><span data-if="dotnet" style="display:none">ScaleImageMax</span><span data-if="python" style="display:none">scale_image_max</span></a></code>, 
<code><a href="learn_ndim_norm.html"><span data-if="hdevelop" style="display:inline">learn_ndim_norm</span><span data-if="c" style="display:none">learn_ndim_norm</span><span data-if="cpp" style="display:none">LearnNdimNorm</span><span data-if="com" style="display:none">LearnNdimNorm</span><span data-if="dotnet" style="display:none">LearnNdimNorm</span><span data-if="python" style="display:none">learn_ndim_norm</span></a></code>
</p>
<h2 id="sec_module">模块</h2>
<p>
Foundation</p>
<!--OP_REF_FOOTER_START-->
<hr>
<div class="indexlink">
<a href="index_classes.html"><span data-if="dotnet" style="display:none;">类别</span><span data-if="cpp" style="display:none;">类别</span></a><span data-if="dotnet" style="display:none;"> | </span><span data-if="cpp" style="display:none;"> | </span><a href="index_by_name.html">算子列表</a>
</div>
<div class="footer">
<div class="copyright">HALCON算子参考手册 Copyright © 2015-2023 51Halcon</div>
</div>
</div>
</body>
</html>
